<template>
  <section class="stats-section">
    <div class="container">
      <div class="stats-grid">
        <div v-for="stat in stats" :key="stat.id" class="stat-card">
          <div class="stat-icon">
            <i :class="stat.icon"></i>
          </div>
          <div class="stat-content">
            <div class="stat-number">{{ stat.value }}</div>
            <div class="stat-label">{{ stat.label }}</div>
            <div class="stat-growth">
              <i class="icon-trending-up"></i>
              <span>+{{ stat.growth }}% 本月</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</template>

<script setup lang="ts">
const stats = [
  {
    id: 1,
    icon: 'icon-users',
    value: '10,000+',
    label: '注册用户',
    growth: 25,
  },
  {
    id: 2,
    icon: 'icon-play',
    value: '50,000+',
    label: '对话次数',
    growth: 40,
  },
  {
    id: 3,
    icon: 'icon-star',
    value: '4.9',
    label: '用户评分',
    growth: 5,
  },
  {
    id: 4,
    icon: 'icon-award',
    value: '95%',
    label: '满意度',
    growth: 3,
  },
]
</script>

<style scoped>
.stats-section {
  padding: 4rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease-out;
  min-width: 200px;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 1.125rem;
  color: #3b82f6;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.stat-label {
  color: #64748b;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.stat-growth {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #10b981;
}

.stat-growth i {
  font-size: 0.8rem;
}

.icon-trending-up::before {
  content: '↗';
}

.icon-users::before {
  content: '👥';
}

.icon-play::before {
  content: '▶';
}

.icon-star::before {
  content: '★';
}

.icon-award::before {
  content: '🏆';
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .stat-number {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }
}
</style>
